package com.freak.kotlinfitnessserver.factory

import com.freak.kotlinfitnessserver.constant.fitness.FitnessProtocolConstant
import com.freak.kotlinfitnessserver.factory.notify.CrossTrainerNotifyFactory
import com.freak.kotlinfitnessserver.factory.notify.FitnessMachineStatusNotifyFactory
import com.freak.kotlinfitnessserver.factory.notify.IndoorBikeNotifyFactory
import com.freak.kotlinfitnessserver.factory.notify.RowerNotifyFactory
import com.freak.kotlinfitnessserver.factory.notify.TrainingStatusNotifyFactory
import com.freak.kotlinfitnessserver.factory.notify.TreadmillNotifyFactory
import java.util.UUID

class NotifyFactory {
    companion object {
        const val TAG: String = "NotifyFactory"
    }

    private val readRequestFactory = mutableMapOf<UUID, INotifyFactory>()

    init {
        readRequestFactory[FitnessProtocolConstant.TreadmillData] = TreadmillNotifyFactory()
        readRequestFactory[FitnessProtocolConstant.IndoorBikeData] = IndoorBikeNotifyFactory()
        readRequestFactory[FitnessProtocolConstant.CrossTrainerData] = CrossTrainerNotifyFactory()
        readRequestFactory[FitnessProtocolConstant.RowerData] = RowerNotifyFactory()
        readRequestFactory[FitnessProtocolConstant.TrainingStatus] = TrainingStatusNotifyFactory()
        readRequestFactory[FitnessProtocolConstant.FitnessMachineStatus] =
            FitnessMachineStatusNotifyFactory()
    }

    fun createFactory(uuid: UUID): INotifyFactory? {
        return readRequestFactory[uuid]
    }
}